import request from '@/utils/request'

export function getDepartmentList() {
  return request({
    url: '/system/dept/getList',
    method: 'get'
  })
}

/**
 * 获取部门负责人
 */

export function getUserList() {
  return request({
    url: '/system/user/getList',
    method: 'get'
  })
}

export function addDepartment(data) {
  return request({
    url: '/system/dept',
    method: 'post',
    data
  })
}

export function getDepartById(id) {
  return request({
    url: '/system/dept/' + id,
    method: 'get'
  })
}

export function updateDepartment(data) {
  return request({
    url: '/system/dept/',
    method: 'put',
    data
  })
}

export function deleteDept(id) {
  return request({
    url: `/system/dept/${id}`,
    method: 'delete'
  })
}

export function getDeptInfoDetail() {
  return request({
    url: `/system/dept/getDetail`,
    method: 'get'
  })
}

export function getPeopleList(params) {
  return request({
    url: `/system/dept/getPeopleList`,
    method: 'get',
    params
  })
}

export function start(data) {
  return request({
    url: `/system/dept/start`,
    method: 'post',
    data: data
  })
}
